// Author: combacsa@kaist.ac.kr
// http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=1035

//#define COMPILE
#ifdef COMPILE

#include <fstream>

using namespace std;

int answer1;
int answer2;

void input() {
    ifstream in("input.txt");
    
    answer1 = 1;
    in >> answer2;
    
    for (int i = 1; i < 9; i++) {
        int a;
        in >> a;
        if (answer2 < a) {
            answer1 = i + 1;
            answer2 = a;
        }
    }
    
    in.close();
}

void output() {
    ofstream out("output.txt");
    
    out << answer2 << endl << answer1;
    
    out.close();
}

int main() {
    input();
    
    
    output();
    return 0;
}


#endif
